//
//  FiveViewController.m
//  DaJiHui
//
//  Created by Hao on 2017/7/7.
//  Copyright © 2017年 Hao. All rights reserved.
//
#import "ThreeTableViewCell.h"
#import "FiveViewController.h"

@interface FiveViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) UITableView *myTableView;



@end

@implementation FiveViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self makeBaseUI];
    // Do any additional setup after loading the view.
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return  5;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return CGFLOAT_MIN;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 4;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.section == 3) {
        return 30;
    }
    
    return 100;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.section == 3){
        UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell3"];
        if (!cell) {
            cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell3"];
            cell.textLabel.textAlignment = NSTextAlignmentLeft;
        }
        
        cell.textLabel.font = [UIFont systemFontOfSize:15];
        cell.textLabel.textAlignment = NSTextAlignmentCenter;
        cell.textLabel.text =[NSString stringWithFormat:@"没有更多了>>"];
        cell.textLabel.textColor = [UIColor getColorFromRGBString:@"#060606"];
        return cell;
    }else{
        ThreeTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
        //cell.selectionStyle = UITableViewCellSelectionStyleNone;
        if (!cell) {
            cell = [[ThreeTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
            
            cell.isFormFirst = YES;
            
        }
        return cell;
        //    for(id temp in cell.contentView.subviews)
        //    {
        //        [temp removeFromSuperview];
        //    }
        
        //cell.textLabel.textAlignment = NSTextAlignmentCenter;
        //cell.textLabel.text =[NSString stringWithFormat:@"222"];
        //cell.textLabel.textColor = [UIColor orangeColor];
        //return cell;
    }
    
}
- (void)makeBaseUI{
    [self.view addSubview:self.myTableView];
    
}

- (UITableView *)myTableView{
    
    if (_myTableView == nil) {
        _myTableView = [[UITableView alloc]initWithFrame:CGRectMake(0,0, ZTY_SCREEN_WIDTH, ZTY_SCREEN_HEIGHT-49-64-44) style:UITableViewStyleGrouped];
        _myTableView.dataSource = self;
        _myTableView.delegate = self;
        _myTableView.sectionFooterHeight = 0;
        _myTableView.sectionHeaderHeight = 0;
        _myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        
    }
    
    return _myTableView;
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
